<?php

/*
  template name: domanderisposte
 */
global $current_user;
get_currentuserinfo();

$args = array(
    "post_type"   => "qa_faqs",
    "post_status" => "publish",
    "posts_per_page"=>"1000"
);


$posts = get_posts( $args );

get_header();
$id=0;
?>
<div id="contenuti">
    <div class="colonna_sx">
    <h4>Domande e risposte</h4>
    </div>
    <div id="container-faq-domande" class="gradient">
        <ol>
  <?php foreach($posts as $key => $value) {?>
    <? $id++; ?>
   
            <li>
                <p class="internalLink viola" goto="<?= $id ?>"><strong><?= $posts[$key]->post_title ?></strong></p>
            </li>
  <?php } ?>
        </ol>
    </div>

<div id="container-faq-risposte">
  <? $id=0; ?>
    <ol>
    <?php foreach($posts as $key => $value) { $id++;?>
        <li>
          <a id="question<?=$id?>" class="viola" name="<?php echo $id; ?>"><?= $posts[$key]->post_title ?></a>
          <span><?= $posts[$key]->post_content ?></span><br/>
          <div class="torna gotop">Torna su</div>
        </li>
    <?php } ?>
    </ol>
</div>
  <div id="askaquestion" class="bottone">
            <a class="bottonProva" href="#" style="">
                <span style="">Prova Lines Perla!</span>
                    Fai una domanda!
                </a>
  </div>
<!--<div><a id="askaquestion" class="faidomanda" href="#">Fai una domanda</a></div>-->
<div id="domanderisposteForm" style='display:none'>
  <div class="floatl faidomanda">
    <form id="faiunadomandaForm">
      <p>
        <input  type='text' id='username' <?if($current_user->user_login == "") echo "value=' username:'"; else echo "value='$current_user->user_login' disabled='disabled'";?> name="username"/>
        <br/><span id="username-err" ></span>
      </p>
      <p>
        <input type='text' id='email' <?if($current_user->user_login == "") echo "value=' email:'"; else echo "disabled='disabled' value='$current_user->user_email'";?> name="email"/>
        <br/><span id="email-err" ></span>
      </p>
      <p>
        <textarea name="domanda" id="domanda">Fai una domanda:</textarea>
        <br/><span id="cap-err" ></span>
      </p>
      <?if(!current_user_can('administrator') && !current_user_can('contributor')){?>
        <p>Voglio ricevere il campione Perla gratuito <input name="checkCampione" id="checkCampione" type='checkbox' onclick='aumenta(this,"ret");'/></p>
      <?} else{?>
        <p>Voglio ricevere il campione <strong>Perla Gamma</strong> gratuito <input name="tipoCampione" id="tipoCampioneg" onclick="aumenta(this);" type='radio' value="gamma"/></p>
        <p>Voglio ricevere il campione <strong>Perla Bustine</strong> gratuito <input name="tipoCampione" id="tipoCampioneb" onclick="aumenta(this);" type='radio' value="bustine"/></p>
        <p>Voglio ricevere il campione <strong>Perla Test</strong> gratuito <input name="tipoCampione" id="tipoCampionet" onclick="aumenta(this);" type='radio' value="test"/></p>
        <p>Non richiedere campione <input checked="checked" value="nocampione" name="tipoCampione" id="tipoCampionen" type='radio' onclick="aumenta(this,'ret');"/></p>
      <?}?>
      <p><input id='invia' type='button' onclick="inviaFormCampione(<?if($current_user->user_login != "") echo "true";?>);" value='Invia' /></p>
    </form>
  </div>
  <div  class="skipnav floatl richiediCampione">
    <form id="richiedicampioneForm">
      <p>
        <input type='text' id='nome' <?if($current_user->user_login == "") echo "value=' nome:'"; else echo "disabled='disabled' value='$current_user->user_firstname'";?> name="nome"/>
        <br/><span id="nome-err" ></span>
      </p>
      <p>
        <input type='text' id='cognome' <?if($current_user->user_login == "") echo "value=' cognome:'"; else echo "disabled='disabled' value='$current_user->user_lastname'";?> name="cognome"/>
        <br/><span id="cognome-err" ></span>
      </p>
      <p>
        <input type='text' id='codicefiscale' value="codice fiscale:" name="codicefiscale"/>
        <br/><span id="codice-err" ></span>
      </p>
      <p>
        <input type='text' id='via' value="via:" name="via"/>
        <br/><span id="via-err" ></span>
      </p>
      <p>
        <input type='text' id='civico' value="civico:" name="civico"/>
        <br/><span id="civico-err" ></span>
      </p>
      <p>
        <input type='text' id='citta' value="città:" name="citta"/>
        <br/><span id="citta-err" ></span>
      </p>
      <p>
        <select name="provincia" id="provincia">

		          <option value="">Seleziona Provincia</option>

		          <option value="AG">AGRIGENTO</option>

		          <option value="AL">ALESSANDRIA</option>

		          <option value="AN">ANCONA</option>

		          <option value="AO">AOSTA</option>

		          <option value="AR">AREZZO</option>

		          <option value="AP">ASCOLI PICENO</option>

		          <option value="AT">ASTI</option>

		          <option value="AV">AVELLINO</option>

		          <option value="BA">BARI</option>

		          <option value="BL">BELLUNO</option>

		          <option value="BN">BENEVENTO</option>

		          <option value="BG">BERGAMO</option>

		          <option value="BI">BIELLA</option>

		          <option value="BO">BOLOGNA</option>

		          <option value="BZ">BOLZANO</option>

		          <option value="BS">BRESCIA</option>

		          <option value="BR">BRINDISI</option>

		          <option value="CA">CAGLIARI</option>

		          <option value="CL">CALTANISSETTA</option>

		          <option value="CB">CAMPOBASSO</option>

		          <option value="CE">CASERTA</option>

		          <option value="CT">CATANIA</option>

		          <option value="CZ">CATANZARO</option>

		          <option value="CH">CHIETI</option>

		          <option value="CO">COMO</option>

		          <option value="CS">COSENZA</option>

		          <option value="CR">CREMONA</option>

		          <option value="KR">CROTONE</option>

		          <option value="CN">CUNEO</option>

		          <option value="EN">ENNA</option>

		          <option value="FE">FERRARA</option>

		          <option value="FI">FIRENZE</option>

		          <option value="FG">FOGGIA</option>

		          <option value="FC">FORLI - CESENA</option>

		          <option value="FR">FROSINONE</option>

		          <option value="GE">GENOVA</option>

		          <option value="GO">GORIZIA</option>

		          <option value="GR">GROSSETO</option>

		          <option value="IM">IMPERIA</option>

		          <option value="IS">ISERNIA</option>

		          <option value="AQ">L'AQUILA</option>

		          <option value="SP">LA SPEZIA</option>

		          <option value="LT">LATINA</option>

		          <option value="LE">LECCE</option>

		          <option value="LC">LECCO</option>

		          <option value="LI">LIVORNO</option>

		          <option value="LO">LODI</option>

		          <option value="LU">LUCCA</option>

		          <option value="MC">MACERATA</option>

		          <option value="MN">MANTOVA</option>

		          <option value="MS">MASSA - CARRARA</option>

		          <option value="MT">MATERA</option>

		          <option value="ME">MESSINA</option>

		          <option value="MI">MILANO</option>

		          <option value="MO">MODENA</option>

		          <option value="NA">NAPOLI</option>

		          <option value="NO">NOVARA</option>

		          <option value="NU">NUORO</option>

		          <option value="OR">ORISTANO</option>

		          <option value="PD">PADOVA</option>

		          <option value="PA">PALERMO</option>

		          <option value="PR">PARMA</option>

		          <option value="PV">PAVIA</option>

		          <option value="PG">PERUGIA</option>

		          <option value="PU">PESARO E URBINO</option>

		          <option value="PE">PESCARA</option>

		          <option value="PC">PIACENZA</option>

		          <option value="PI">PISA</option>

		          <option value="PT">PISTOIA</option>

		          <option value="PN">PORDENONE</option>

		          <option value="PZ">POTENZA</option>

		          <option value="PO">PRATO</option>

		          <option value="RG">RAGUSA</option>

		          <option value="RA">RAVENNA</option>

		          <option value="RC">REGGIO DI CALABRIA</option>

		          <option value="RE">REGGIO NELL'EMILIA</option>

		          <option value="RI">RIETI</option>

		          <option value="RN">RIMINI</option>

		          <option value="RM">ROMA</option>

		          <option value="RO">ROVIGO</option>

		          <option value="SA">SALERNO</option>

		          <option value="SS">SASSARI</option>

		          <option value="SV">SAVONA</option>

		          <option value="SI">SIENA</option>

		          <option value="SR">SIRACUSA</option>

		          <option value="SO">SONDRIO</option>

		          <option value="TA">TARANTO</option>

		          <option value="TE">TERAMO</option>

		          <option value="TR">TERNI</option>

		          <option value="TO">TORINO</option>

		          <option value="TP">TRAPANI</option>

		          <option value="TN">TRENTO</option>

		          <option value="TV">TREVISO</option>

		          <option value="TS">TRIESTE</option>

		          <option value="UD">UDINE</option>

		          <option value="VA">VARESE</option>

		          <option value="VE">VENEZIA</option>

		          <option value="VB">VERBANO-CUSIO-OSSOLA</option>

		          <option value="VC">VERCELLI</option>

		          <option value="VR">VERONA</option>

		          <option value="VV">VIBO VALENTIA</option>

		          <option value="VI">VICENZA</option>

		          <option value="VT">VITERBO</option>

		        </select>
        <br/><span id="provincia-err" ></span>
      </p>
      <p>
        <input type='text' id='cap' value="cap:" name="cap"/>
        <br/><span id="cap-err" ></span>
      </p>
    </form>
  </div>
  <div class="clear"></div>
</div>
</div>
<?php get_footer();?>
